package com.suse.util;
import lombok.Data;

// ResultVo类，用于封装接口返回结果
@Data
public class ResultVo {
    private Integer code;
    private String msg;
    private Object data;

    public ResultVo(Integer code, String msg, Object data) {
        this.code = code;
        this.msg = msg;
        this.data = data;
    }

    public static ResultVo success(){
        return new ResultVo(200,"成功",null);
    }

    public static ResultVo success(String msg,Object data){
        return new ResultVo(200,msg,data);
    }

    public static ResultVo success(String msg){
        return new ResultVo(200,msg,null);
    }

    public static ResultVo error(){
        return new ResultVo(500,"失败",null);
    }

    public static ResultVo error(String msg){
        return new ResultVo(500,msg,null);
    }
}
